package com.dinzeer.resonantisshelomoh.data;

import cn.mmf.slashblade_addon.registry.SBASpecialEffectsRegistry;
import com.dinzeer.resonantisshelomoh.Resonantisshelomoh;
import com.dinzeer.resonantisshelomoh.regsiter.CreativeTab;
import com.dinzeer.resonantisshelomoh.regsiter.RSSpecialEffectsRegistry;
import com.dinzeer.resonantisshelomoh.regsiter.RSitemRegsitry;
import com.dinzeer.resonantisshelomoh.regsiter.RSslashartRegsitry;
import mods.flammpfeil.slashblade.item.SwordType;
import mods.flammpfeil.slashblade.registry.SlashArtsRegistry;
import mods.flammpfeil.slashblade.registry.slashblade.EnchantmentDefinition;
import mods.flammpfeil.slashblade.registry.slashblade.PropertiesDefinition;
import mods.flammpfeil.slashblade.registry.slashblade.RenderDefinition;
import mods.flammpfeil.slashblade.registry.slashblade.SlashBladeDefinition;
import net.minecraft.data.worldgen.BootstapContext;
import net.minecraft.resources.ResourceKey;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.enchantment.Enchantment;
import net.minecraft.world.item.enchantment.Enchantments;
import net.minecraftforge.registries.ForgeRegistries;

import java.util.List;

public class RSBuiltInRegsitry {



  public static List<ResourceKey<SlashBladeDefinition>> solomons = List.of();


    //所罗门·中阶段
    public static final ResourceKey<SlashBladeDefinition> Reversed=register("reversed");
    //节制之种
    public static final ResourceKey<SlashBladeDefinition> temperance=register("temperance");
    //反思之芽
    public static final ResourceKey<SlashBladeDefinition> reflection=register("reflection");
    //所罗门
    public static final ResourceKey<SlashBladeDefinition> solomon=register("solomon");
    //逆位「所罗门」
    public static final ResourceKey<SlashBladeDefinition> reverse_solomon=register("reverse_solomon");

    public static void registerAll(BootstapContext<SlashBladeDefinition> bootstrap) {

        bootstrap.register(
                Reversed, new SlashBladeDefinition(Resonantisshelomoh.prefix("reversed"),
                        RenderDefinition.Builder.newInstance()
                                .textureName(Resonantisshelomoh.prefix("model/speed/speed.png"))
                                .modelName(Resonantisshelomoh.prefix("model/speed/speed.obj"))
                                .effectColor(16711680)
                                .build(),
                        PropertiesDefinition.Builder.newInstance()
                                .defaultSwordType(List.of(SwordType.BEWITCHED))
                                .slashArtsType(RSslashartRegsitry.ALLOVER.getId())
                                .addSpecialEffect(SBASpecialEffectsRegistry.BURST_DRIVE.getId())
                                .baseAttackModifier(20)
                                .maxDamage(200)
                                .build(),
                        List.of(
                                new EnchantmentDefinition(getEnchantmentID(Enchantments.UNBREAKING), 10),
                                new EnchantmentDefinition(getEnchantmentID(Enchantments.SMITE), 10)
                        ),
                        CreativeTab.Slashblade.getId()
                )
        );
        bootstrap.register(
                temperance, new SlashBladeDefinition(Resonantisshelomoh.prefix("temperance"),
                        RenderDefinition.Builder.newInstance()
                                .textureName(Resonantisshelomoh.prefix("model/solmen/temperance.png"))
                                .modelName(Resonantisshelomoh.prefix("model/solmen/temperance.obj"))
                                .build(),
                        PropertiesDefinition.Builder.newInstance()
                                .defaultSwordType(List.of(SwordType.BEWITCHED))
                                .baseAttackModifier(7)
                                .slashArtsType(SlashArtsRegistry.DRIVE_VERTICAL.getId())
                                .maxDamage(200)
                                .build(),
                        List.of( ),
                        CreativeTab.Slashblade.getId()
                )
        );
        bootstrap.register(
                reflection, new SlashBladeDefinition(Resonantisshelomoh.prefix("reflection"),
                        RenderDefinition.Builder.newInstance()
                                .textureName(Resonantisshelomoh.prefix("model/solmen/reflection.png"))
                                .modelName(Resonantisshelomoh.prefix("model/solmen/reflection.obj"))
                                .build(),
                        PropertiesDefinition.Builder.newInstance()
                                .defaultSwordType(List.of(SwordType.BEWITCHED))
                                .baseAttackModifier(12)
                                .slashArtsType(RSslashartRegsitry.ALLOVER.getId())
                                .maxDamage(200)
                                .build(),
                        List.of(),
                        CreativeTab.Slashblade.getId())
        );
        bootstrap.register(
                solomon, new SlashBladeDefinition(
                        RSitemRegsitry.RS_SLASH_BLADE.getId(),
                        Resonantisshelomoh.prefix("solomon"),
                        RenderDefinition.Builder.newInstance()
                                .textureName(Resonantisshelomoh.prefix("model/solmen/solomon.png"))
                                .modelName(Resonantisshelomoh.prefix("model/solmen/solomon.obj"))
                                .effectColor(21503)
                                .build(),
                        PropertiesDefinition.Builder.newInstance()
                                .defaultSwordType(List.of(SwordType.BEWITCHED))
                                .slashArtsType(RSslashartRegsitry.ALLOVEREX2.getId())
                                .addSpecialEffect(RSSpecialEffectsRegistry.Theinescapableguilt.getId())
                                .addSpecialEffect(RSSpecialEffectsRegistry.HelplessRest.getId())
                                .addSpecialEffect(RSSpecialEffectsRegistry.Anuntraceablehope.getId())
                                .baseAttackModifier(40)
                                .maxDamage(200)
                                .build(),
                        List.of(
                                new EnchantmentDefinition(getEnchantmentID(Enchantments.UNBREAKING), 10),
                                new EnchantmentDefinition(getEnchantmentID(Enchantments.SMITE), 10)
                        ),
                        CreativeTab.Slashblade.getId())
        );
        bootstrap.register(
                reverse_solomon,
                new SlashBladeDefinition(
                        RSitemRegsitry.RS_SLASH_BLADE.getId(),
                        Resonantisshelomoh.prefix("reverse_solomon"),
                        RenderDefinition.Builder.newInstance()
                                .textureName(Resonantisshelomoh.prefix("model/solmen/reverse_solomon.png"))
                                .modelName(Resonantisshelomoh.prefix("model/solmen/reverse_solomon.obj"))
                                .effectColor(16711680)
                                .build(),
                        PropertiesDefinition.Builder.newInstance()
                                .defaultSwordType(List.of(SwordType.BEWITCHED))
                                .slashArtsType(RSslashartRegsitry.ALLOVEREX.getId())
                                .addSpecialEffect(RSSpecialEffectsRegistry.OccupyingHeart.getId())
                                .addSpecialEffect(RSSpecialEffectsRegistry.SeizetheBlood.getId())
                                .addSpecialEffect(RSSpecialEffectsRegistry.CompassionforTorture.getId())
                                .baseAttackModifier(40)
                                .maxDamage(200)
                                .build(),
                        List.of(
                                new EnchantmentDefinition(getEnchantmentID(Enchantments.UNBREAKING), 10),
                                new EnchantmentDefinition(getEnchantmentID(Enchantments.SMITE), 10)
                        ),
                        CreativeTab.Slashblade.getId())
        );
    }






    private static ResourceKey<SlashBladeDefinition> register(String id) {






        return ResourceKey.create(SlashBladeDefinition.REGISTRY_KEY, Resonantisshelomoh.prefix(id));
    }
    static ResourceLocation getEnchantmentID(Enchantment enchantment) {
        return ForgeRegistries.ENCHANTMENTS.getKey(enchantment);
    }

}
